package com.itheima.utils;

import java.io.FileInputStream;
import java.util.List;

public class ExcelTest {

    public static void main(String[] args) throws Exception {
//        //1.读取excel文件-->workbook
        FileInputStream inputStream = new FileInputStream("c:/work/hello.xlsx");
//        XSSFWorkbook workbook = new XSSFWorkbook(inputStream);
//        //2.读取sheet
//        XSSFSheet sheet = workbook.getSheetAt(0);
//        //3.读取行row
//        XSSFRow row = sheet.getRow(0);
//        //4.读取单元格cell
//        XSSFCell cell = row.getCell(3);
//        //5.输出
//        System.out.println(cell.getStringCellValue());
//        //6.关闭流
//        inputStream.close();
//        workbook.close();
        List<String[]> list = POIUtils.readExcel(inputStream, "hello.xlsx");
        for(String[] datas : list){
            for(String data : datas){
                System.out.print(data);
            }
            System.out.println();
        }
    }

}
